<template name="organizationSettingsBlurb">
{{#let txt="admin.organization.organizationSettingsBlurb"}}
  <p>
    {{_ (con txt "explanation")}}
  </p>
{{/let}}
</template>

<template name="newAdminOrganization">
{{#let txt="admin.organization.newAdminOrganization"}}
  <h1>
    <ul class="admin-breadcrumbs">
      <li>{{#linkTo route="newAdminRoot"}}{{_ "admin.title"}}{{/linkTo}}</li>
      <li>{{_ "admin.organization.name"}}</li>
    </ul>
  </h1>

  {{> organizationSettingsBlurb "" }}

  {{#if hasSuccess }}
    {{#focusingSuccessBox}}
      {{_ (con txt "success")}}
    {{/focusingSuccessBox}}
  {{/if}}

  {{#if hasError}}
    {{#focusingErrorBox}}
      {{_ (con txt "error") message}}
    {{/focusingErrorBox}}
  {{/if}}

  <form class="admin-organization-management-form {{#if formDisabled}}disabled{{/if}}">
    <h2>{{_ (con txt "membership.title")}}</h2>

    <div class="org-membership">
      <div class="checkbox-group">
        <label>
          <input type="checkbox" name="email-toggle" checked="{{emailChecked}}" disabled="{{emailDisabled}}" />
          {{_ (con txt "membership.emailToggle.label")}}
        </label>
        {{#if emailDisabled }}
        <span class="form-subtext">{{_ (con txt "membership.emailToggle.subtext")}}</span>
        {{/if}}
        <div class="form-group">
          <label>{{_ (con txt "membership.emailDomain.label")}}
            <input type="text" name="email-domain" value="{{emailDomain}}" disabled="{{emailDisabled}}" />
          </label>
          <span class="form-subtext">
            {{_ (con txt "membership.emailDomain.subtext")}}
          </span>
        </div>
      </div>

      <div class="checkbox-group">
        <label>
          <input type="checkbox" name="gapps-toggle" checked="{{gappsChecked}}" disabled="{{gappsDisabled}}" />
          {{_ (con txt "membership.gappsToggle.label")}}
        </label>
        {{#if gappsDisabled }}
        <span class="form-subtext">{{_ (con txt "membership.gappsToggle.subtext")}}</span>
        {{/if}}
        <div class="form-group">
          <label>{{_ (con txt "membership.gappsDomain.label")}}
            <input type="text" name="gapps-domain" value="{{gappsDomain}}" disabled="{{gappsDisabled}}" />
          </label>
          <span class="form-subtext">
            {{_ (con txt "membership.gappsDomain.subtext")}}
          </span>
        </div>
      </div>

      <div class="checkbox-group">
        <label>
          <input type="checkbox" name="ldap-toggle" checked="{{ldapChecked}}" disabled="{{ldapDisabled}}" />
          {{_ (con txt "membership.ldapToggle.label")}}
        </label>
        {{#if ldapDisabled }}
        <span class="form-subtext">{{_ (con txt "membership.ldapToggle.subtext")}}</span>
        {{/if}}
      </div>

      <div class="checkbox-group">
        <label>
          <input type="checkbox" name="oidc-toggle" checked="{{oidcChecked}}" disabled="{{oidcDisabled}}" />
          {{_ (con txt "membership.oidcToggle.label")}}
        </label>
        {{#if oidcDisabled }}
        <span class="form-subtext">{{_ (con txt "membership.oidcToggle.subtext")}}</span>
        {{/if}}
      </div>

      <div class="checkbox-group">
        <label>
          <input type="checkbox" name="saml-toggle" checked="{{samlChecked}}" disabled="{{samlDisabled}}" />
          {{_ (con txt "membership.samlToggle.label")}}
        </label>
        {{#if samlDisabled }}
        <span class="form-subtext">{{_ (con txt "membership.samlToggle.subtext")}}</span>
        {{/if}}
      </div>
    </div>

    <h2>{{_ (con txt "settings.title")}}</h2>
    <div class="org-settings">
      <div class="checkbox-group">
        <label>
          <input type="checkbox" name="disallow-guests" checked={{disallowGuests}} disabled="{{formDisabled}}" />
          {{_ (con txt "settings.disallowGuests.label")}}
        </label>
        <span class="form-subtext">
          {{_ (con txt "settings.disallowGuests.subtext")}}
        </span>
      </div>

      <div class="checkbox-group">
        <label>
          <input type="checkbox" name="share-contacts" checked="{{shareContacts}}" disabled="{{formDisabled}}" />
          {{_ (con txt "settings.shareContacts.label")}}
        </label>
        <span class="form-subtext">
          {{_ (con txt "settings.shareContacts.subtext")}}
        </span>
      </div>
    </div>

    <div class="button-row">
      <button class="save" type="submit" disabled="{{saveDisabled}}">{{_ (con txt "saveButton")}}</button>
    </div>
  </form>
{{/let}}
</template>
